package org.crazyit.activiti_d1._10_DisableValidation;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.DeploymentBuilder;

public class DisableValidation {

    public static void main(String[] args) {

        //1. 创建流程引擎
        ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();

        //2. 得到流程存储服务实例
        RepositoryService repositoryService = engine.getRepositoryService();

        //3. 部署一份错误的xml 文件, 不会报错
        DeploymentBuilder builderA = repositoryService.createDeployment();
        builderA.addClasspathResource("xmlError.bpmn").disableSchemaValidation().deploy();

        //4. 部署一份不可执行的bpmn 文件, 不会报错
        DeploymentBuilder builderB = repositoryService.createDeployment();
        builderB.addClasspathResource("bpmnError.bpmn").disableBpmnValidation().deploy();

    }

}
